//
// Created by DELL on 2021/3/12.
//
#include "sylar.h"

sylar::Logger::ptr g_logger = SYLAR_LOG_ROOT();

sylar::Timer::ptr timer;
void test_timer() {
    sylar::IOManager ioManager(2,true,"io");
     timer = ioManager.addTimer(1000, []() {
        static int i = 0;
        SYLAR_LOG_INFO(g_logger) << "hello timer, i = " << i;
        if (++i == 5){
            timer->reset(2000,true);
//            timer->cancel();
        }
    }, true);
}

int main(int argc, char **argv) {
    test_timer();
    return 0;
}